var form, layer;
layui.use(['layer', 'form'], function () {
    layer = layui.layer;
    form = layui.form;

    //自定义验证规则
    form.verify({
        name: function (value) {
            if (value.length < 5) {
                return '姓名至少得5个字符啊';
            }
        }
    });

    //监听提交
    form.on('submit(save_character)', function (data) {

        // $('input[name=content]').val($("#summernote").summernote('code'));

        // $(data.form).submit();

    });
});

/**
 * 编辑
 * @param id
 */
function edit(id) {
    location.href = '/admin/blog/' + id + '/edit';
}


